package online.longzipeng.mywebdemo.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import online.longzipeng.mywebdemo.pojo.dto.UserSearchDTO;
import online.longzipeng.mywebdemo.entity.User;
import online.longzipeng.mywebdemo.service.UserService;
import online.longzipeng.mywebdemo.commen.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: lzp
 * @description:
 * @Date: 2023/1/9
 */
@RestController
@RequestMapping("/user")
public class UserController {

	@Autowired
	private UserService userService;

	@PostMapping("/page")
	public Result<Page<User>> page(@RequestBody UserSearchDTO param) {
		return Result.success(userService.page(param));
	}
}
